home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / CC_C / 0574.ZIP / GETDRV.ASM < prev    next >
Assembly Source File  |  1986-11-21  |  666b  |  42 lines

  1. include compiler.inc
  2.  
  3.     ttl    GETDRV, 1.01, 11-21-86, cr
  4.  
  5. ; gets current drive or current directory to DST
  6.  
  7.     dseg
  8.     cseg
  9.  
  10.                 ;getdrv(dst) char *dst;
  11.     procdef    getdrv,<<dst,ptr>>
  12.     pushreg
  13.     pushds
  14.     mov    ax,1900h    ; get drive code
  15.     int    21h
  16.     add    al,'A'        ; convert to alpha
  17.     ldptr    di,dst
  18.     cld
  19.     stosb
  20.     mov    al,':'        ; separator
  21.     stosb
  22.     xor    al,al        ; set in EOS
  23.     stosb
  24.     pret
  25.     pend    getdrv
  26.  
  27.                 ;getdir(dst) char *dst;
  28.     procdef    getdir,<<dst1,ptr>>
  29.  
  30.     pushreg
  31.     pushds
  32.     ldptr    si,dst1
  33.     mov    ax,'\'        ; set in leading separator
  34.     mov    [si], ax
  35.     mov    ax,4700h    ; get current dir to DS:SI
  36.     inc    si        ; past '\'
  37.     xor    dl,dl
  38.     int    21h
  39.     pret
  40.     pend    getdir
  41.     finish
  42.